<%
class FeedbackAction 'extends CommonAction
	
	sub sendMail()
		dim data,mail,m,bool:bool = false
		set data = json_decode( POP_MVC.post("_data") )
		
		mail = send_mail( data("mail"), data("reply_title"),data("reply") )
		if is_empty(mail) then
			set m = M_("feedback")
			data("is_reply") = data("is_reply") + 1
			data("reply_title") = now()
			if m.db.data(data).create(2) then
				if m.db.save() then
					bool = true
				end if
			end if
			
			if bool Then
				that.ajaxReturn( array(1 ,"邮件发送成功",1) )
			else
				that.ajaxReturn( array(0 ,"邮件发送成功，数据写入数据库失败",0) )
			end if			
		else
			call that.ajaxReturn( array(mail ,"邮件发送失败" ,0) )
		end if
	end sub
	
end class
%>